package java_test;

import java.lang.reflect.Field;

public class testOfBean {
    public static void main(String[] args) throws Exception {
        ABC a = new ABC();
        ABC b = new ABC();
        a.setName("123");




        Field[] fs = ABC.class.getDeclaredFields();
        for (Field field :fs){
            String name = field.getName();
            name = name.substring(0, 1).toUpperCase() + name.substring(1);
            String value = (String) ABC.class.getMethod("get" + name).invoke(a);
            ABC.class.getMethod("set" + name,String.class).invoke(b,value);
        }





    }
}

class ABC{
    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
